package org.lt.resume.controller.user;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.lt.resume.service.userserviceInterface.UserServiceInterface;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;


public class LoginController extends AbstractController{

	private UserServiceInterface userservice;


	@Override
	protected ModelAndView handleRequestInternal(HttpServletRequest request,
			HttpServletResponse response) throws Exception {
		// TODO Auto-generated method stub
		
		String username = request.getParameter("username");
		String password = request.getParameter("password");
		if (userservice.hasMatchUser(username))
		    return new ModelAndView("main");
		else 
		    return null;
//		return new ModelAndView("main");

	}

	public UserServiceInterface getUserservice() {
		return userservice;
	}

	public void setUserservice(UserServiceInterface userservice) {
		this.userservice = userservice;
	}
}
